﻿using System;
using System.Data;

namespace msBsc.WebUi
{
    public partial class wfIframGoodsSel : msBsc.Cls.BPDealer
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindControls();
                loadGoodslist();
            }
        }

        private void BindControls()
        {
            if (!IsPostBack)
            {
            }
        }
        private void loadGoodslist()
        {
            using (msBsc.AppLogic.DataAlc.CBizShpCommercialPageColumn odataobj = new AppLogic.DataAlc.CBizShpCommercialPageColumn())
            {
                DataSet ds = odataobj.DataObj.QueryBySQL(@"
	SELECT  
	C.GOODS_ID
	,C.GOODS_NME
	,C.IMG_URL
	FROM  
	SHP_GOODS_INFO C 
	WHERE
	(C.COMM_TENANT_ID='" + msBsc.SvRef.UserInfo.OperDealerId.Split(',')[0] + @"') ORDER BY C.GOODS_NME ASC
");

                string strjsontem1 = msBsc.AppLogic.Cfg.HttpTools.GetJsonByTable(ds.Tables[0], ""
                    , ""
                    , 1, 1000, "GOODS_NME ASC");
                //                this.ExecJScript(@"debugger;
                //                "); 
                this.ExecJScript(@" var data= " + strjsontem1 + @" ; 
                doBoundGoodsList( data,'');");
            }
        }


        //重构基类的回调处理函数，以strAction属性来判断是什么类型的回调，该变量的值对应前台的ACTION参数，如：按钮的名称等
        public override void InitialByParam()
        {
            if (strAction == "loadGoodslist")//根据传入的回调类型进行处理，这里响应编辑按钮
            {
                loadGoodslist();
            } 

            base.InitialByParam();
        } 

    }
}